<?php

use yii\widgets\ActiveForm;
use yii\widgets\LinkPager;
use common\helpers\Url;
use common\helpers\Html;

$this->title = '杠杆管理';
$this->params['breadcrumbs'][] = ['label' => $this->title];
?>

<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h3 class="box-title"><?= $this->title; ?></h3>
                <div class="box-tools">
                    <?= Html::create(['ajax-edit'], '创建', [
                        'data-toggle' => 'modal',
                        'data-target' => '#ajaxModalLg',
                    ]) ?>
                </div>
                <div class="col-sm-12" style="margin-top: 10px;">
                    <?php $form = ActiveForm::begin([
                        'action' => Url::to(['index']),
                        'method' => 'get',
                    ]); ?>

                    <div class="col-sm-3">
                        <div class="input-group">

                            <?= Html::textInput('keyword', $keyword, [
                                'class' => 'form-control',
                                'id' => 'test-input',
                                'placeholder' => '请输入分类名称',
                            ]) ?>

                            <span class="input-group-btn"><button class="btn btn-white"><i
                                            class="fa fa-search"></i> 搜索</button></span>

                        </div>
                    </div>

                    <?php ActiveForm::end(); ?>

                </div>
            </div>
            <div class="box-body table-responsive">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>#</th>
                        <th>名称</th>
                        <th>描述</th>
                        <th>盈损配置</th>
                        <th>配资比率</th>
                        <th>配资利息</th>
                        <th>配资周期</th>
                        <th>最低金额</th>
                        <th>最高金额</th>
                        <th>最低余额</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php foreach ($models as $key => $model) { ?>
                        <tr id= <?= $model->id; ?>>
                            <td><?= $key + 1; ?></td>
                            <td><?= $model->name; ?></td>
                            <td><?= $model->desc; ?></td>
                            <td><?= $model->profit; ?></td>
                            <td><?= $model->ratio; ?></td>
                            <td><?= $model->interest; ?></td>
                            <td><?= $model->cycle; ?></td>
                            <td><?= $model->min; ?></td>
                            <td><?= $model->max; ?></td>
                            <td><?= $model->limit; ?></td>
                            <td>
                                <?= Html::edit(['ajax-edit', 'id' => $model->id], '编辑', [
                                    'data-toggle' => 'modal',
                                    'data-target' => '#ajaxModalLg',
                                ]); ?>
                                <?= Html::delete(['delete', 'id' => $model->id]); ?>
                            </td>
                        </tr>
                    <?php } ?>
                    </tbody>
                </table>
            </div>
            <div class="box-footer">
                <?= LinkPager::widget([
                    'pagination' => $pages,
                ]); ?>
            </div>
        </div>
    </div>
</div>